<?php
$this->_var['ucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.core.js";
$this->_var['ucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.widget.js";
$this->_var['ucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.datepicker.js";

$this->_var['cpucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.core.js";
$this->_var['cpucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.widget.js";
$this->_var['cpucctojs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.datepicker.js";

$this->_var['ucctcss'][] = $this->_var['TMPL_REAL']."/css/datepicker.css";
?>

<script type="text/javascript" src="{function name="parse_script" v="$ucctojs" c="$cpucctojs"}"></script>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$ucctcss"}" />
<div class="inc wb">
	<div class="inc_top">{$page_title}</div>
	<div class="inc_main">
		<div class="sub_nav">
			<span {if $ACTION_NAME eq 'index'}class="act"{/if}><a href="{url x="shop" r="uc_order#index"}">{$LANG.UC_ORDER}</a></span>
			<span {if $ACTION_NAME eq 'lottery'}class="act"{/if}><a href="{url x="shop" r="uc_order#lottery"}">{$LANG.UC_LOTTERY}</a></span>
			<span {if $ACTION_NAME eq 'ct'}class="act"{/if}><a href="{url x="shop" r="uc_order#ct"}">{$LANG.UC_CT}</a></span>
			<span {if $ACTION_NAME eq 'ktv'}class="act"{/if}><a href="{url x="shop" r="uc_order#ktv"}">{$LANG.UC_KTV}</a></span>
			<span {if $ACTION_NAME eq 'takeaway'}class="act"{/if}><a href="{url x="shop" r="uc_order#takeaway"}">{$LANG.UC_TAKEAWAY}</a></span>
		</div>
		<div class="blank1"></div>
		<div  class="uc-table">
			<div class="clearfix">
				<form action="{url x="index" r="uc_order#ktv"}" method="post">
					<select name="timetype">
						<option value="1" {if $smarty.request.timetype eq "1"}selected="selected"{/if}>K歌时间</option>
						<option value="2" {if $smarty.request.timetype eq "2"}selected="selected"{/if}>预订时间</option>
					</select>
					<input type="text" name="begindate" id="uc_ct_begin_date" class="w100" value="{$smarty.request.begindate}">
					至
					<input type="text" name="enddate" id="uc_ct_end_date" class="w100" value="{$smarty.request.enddate}">
					<b>&nbsp;KTV名称</b>
					<input type="text" name="ct_name" value="{$smarty.request.ct_name}">
					<select name="status">
						<option value="-1" {if $smarty.request.status eq "-1"}selected="selected"{/if}>全部</option>
						<option value="0" {if $smarty.request.status eq "0"}selected="selected"{/if}>订单处理中</option>
						<option value="1" {if $smarty.request.status eq "1"}selected="selected"{/if}>等待K歌</option>
						<option value="2" {if $smarty.request.status eq "2"}selected="selected"{/if}>K歌到达</option>
						<option value="3" {if $smarty.request.status eq "3"}selected="selected"{/if}>退订成功</option>
						<option value="4" {if $smarty.request.status eq "4"}selected="selected"{/if}>订单失败</option>
					</select>
					<input type="submit" name="ct_submit" style="border:0" class="gray_s_btn" value="确定">
				</form>
			</div>
			<div class="blank"></div>
			<table cellspacing="0" cellpadding="0" border="0">
								<tr>
									<th width="125">K歌时间</th>
									<th width="125">预订时间</th>
									<th>KTV名称</th>
									<th width="90">{$LANG.ORDER_STATUS}</th>
									<th width="70">消费金额</th>
									<th width="215">{$LANG.OPERATION}</th>
								</tr>
								{foreach from=$list item=order key=key}
								<tr {if $key mod 2 eq  0}class="alt"{/if}>
									<td style="text-align:left;">
									{function name="to_date" value=$order.order_time f='Y-m-d'} {function name="to_date" value=$order.order_time f='H:i'}	
									</td>
									<td style="text-align:left;">{function name="to_date" value=$order.create_time f='Y-m-d'} {function name="to_date" value=$order.create_time f='H:i'}</td>
									<td style="text-align:left;">
										<a href="{url x="store" r="kview" p="id=$order.supplier_location_id"}" target="_blank">{$order.location_name}</a>
									</td>
									<td>
										{if $order.status eq 0}
										订单处理中
										{elseif $order.status eq 1}
										<span class="cg">等待K歌</span>
										{elseif $order.status eq 2}
										<span style="color:red">K歌到达</span>	
										{elseif $order.status eq 3}
										退订成功
										{elseif $order.status eq 4}
										订单失败{if $order.order_tip}<a href="javascript:void(0);" title="{$order.order_tip}" class="ml5 icons i005"></a>{/if}
										{/if}
									</td>
									<td>{if $order.order_money}{$order.order_money}{else}0{/if}</td>
									<td style="text-align:left;">
										 <span class="grebtn grebtn_s mr5" style="line-height:1.4">
						                    <i class="green_line" style="width:80px"></i>
						                    <strong class="grebtn_in">
						                    	<a href="{url x="shop" r="uc_order#view_ct" p="id=$order.id"}">查看订单</a></strong>
						                    <i class="green_line" style="width:80px"></i>
						                </span>
										{if $order.order_time gt get_gmtime()}
										<a href="{url x="store" r="order#modify" p="id=$order.id"}" class="gray_s_btn mr5">修改</a>
										{/if}
										{if $order.status neq 2 && $order.status neq 3 && $order.status neq 4}
										<a href="{url x="store" r="order#del" p="id=$order.id"}" id="bookOrderCancel" class="gray_s_btn">撤销</a>
										{/if}
									</td>
								</tr>
								{/foreach}
						</table>
						
						<div class="blank"></div>
						<div class="pages">{$pages}</div>
		</div>				
		
	</div>
	<div class="inc_foot"></div>
</div>
<script type="text/javascript">
	$("#uc_ct_begin_date").datepicker({
		dateFormat: 'yy-mm-dd'
	});
	$("#uc_ct_end_date").datepicker({
		dateFormat: 'yy-mm-dd'
	});
</script>